#include<iostream>
#include<cstring>
using namespace std;
struct node
{
	int x,y,t;
}nums[13];

bool arr[13];

// vector<int> path;
bool dfs(int n,int end,int k)
{
	if(k==n)
	{
		return true;
	}
	bool change=false;
	for(int i=1;i<=n;i++)
	{
		if(arr[i]==false)
		{
			if(end<=nums[i].y)
			{
				arr[i]=true;
				int y=max(end,nums[i].x);
				change=change||dfs(n,y+nums[i].t,k+1);
				arr[i]=false;
			}
		}
	}
	return change;
}
int main()
{
	int n;cin>>n;
	while(n--)
	{
		int m;cin>>m;
		memset(nums,0,sizeof(nums));
		for(int i=1;i<=m;i++)
		{
			cin>>nums[i].x>>nums[i].y>>nums[i].t;
			nums[i].y+=nums[i].x;
		}
		if(dfs(m,0,0))
		{
			cout<<"YES"<<endl;
		}
		else
		{
			cout<<"NO"<<endl;
		}
	}
}